Put the set size in the structure on set-allocation.
authorEwan Mellor <ewan@xensource.com>
Tue, 20 Feb 2007 23:59:13 +0000 (23:59 +0000)
committerEwan Mellor <ewan@xensource.com>
Tue, 20 Feb 2007 23:59:13 +0000 (23:59 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/libxen/include/xen_internal.h

index 324fb8842858e1d6cede8ae6b850cdf31ec5d376..ac50de20b211c0be0795eec8f2c6378b5a429a37 100644 (file)
@@ -149,7 +149,10 @@ type__ ## _free(type__ handle)                  \
 type__ ## _set *                                                        \
 type__ ## _set_alloc(size_t size)                                       \
 {                                                                       \
-    return calloc(1, sizeof(type__ ## _set) + size * sizeof(type__));   \
+    type__ ## _set *result = calloc(1, sizeof(type__ ## _set) +         \
+                                    size * sizeof(type__));             \
+    result->size = size;                                                \
+    return result;                                                      \
 }                                                                       \
                                                                         \
 void                                                                    \